/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #262626;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: all 0.3s ease;
}

/* 新增：全局设计变量 */
:root {
  --color-bg: #f5f7fb;
  --color-bg-panel: #ffffff;
  --color-primary: #667eea;
  --color-primary-2: #764ba2;
  --color-text: #262626;
  --color-text-secondary: #595959;
  --color-border: #e8e8e8;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --font-sm: 12px;
  --font-md: 14px;
  --font-lg: 16px;
  --font-xl: 18px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0,21,41,0.08);
  --menu-item-height: 60px;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(241, 241, 241, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-2) 100%);
  border-radius: 10px;
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: scale(1.1);
}

#root {
  height: 100vh;
}

/* 侧边栏自定义样式 */
.ant-layout-sider {
  box-shadow: var(--shadow-sm);
}

/* 菜单项样式 */
.ant-menu-light .ant-menu-item {
  margin: 4px 12px;
  border-radius: var(--radius-md);
  height: var(--menu-item-height);
  line-height: var(--menu-item-height);
  transition: all 0.3s ease;
  border: none;
}

.ant-menu-light .ant-menu-item:hover {
  background: rgba(102, 126, 234, 0.08) !important;
  color: var(--color-primary) !important;
}

.ant-menu-light .ant-menu-item-selected {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-2) 100%) !important;
  color: #fff !important;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ant-menu-light .ant-menu-item-selected .anticon {
  color: #fff !important;
}

.ant-menu-light .ant-menu-item .anticon {
  font-size: 16px;
  margin-right: 12px;
  transition: all 0.3s ease;
}

.ant-menu-light .ant-menu-item:hover .anticon {
  color: var(--color-primary) !important;
  transform: scale(1.1);
}

.ant-menu-light .ant-menu-item-selected:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
}

/* 菜单项文字样式 */
.ant-menu-light .ant-menu-item .ant-menu-title-content {
  font-size: var(--font-lg);
  font-weight: 400;
  transition: all 0.3s ease;
}

.ant-menu-light .ant-menu-item-selected .ant-menu-title-content {
  font-weight: 500;
}

/* 折叠按钮样式 */
.ant-layout-sider-trigger {
  background: var(--color-bg-panel) !important;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary) !important;
  transition: all 0.3s ease;
}

.ant-layout-sider-trigger:hover {
  background: #f5f5f5 !important;
  color: var(--color-primary) !important;
}

/* 全局动画类 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease-out;
}

.fade-in-right {
  animation: fadeInRight 0.6s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

/* 按钮动画效果 */
.ant-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ant-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ant-btn:active::before {
  width: 300px;
  height: 300px;
}

.ant-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 表单元素动画 */
.ant-input, .ant-select-selector {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ant-input:focus, .ant-select-focused .ant-select-selector {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(24, 144, 255, 0.15);
}

/* 卡片加载动画 */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* 菜单动画效果 */
.ant-menu-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 12px !important;
  margin: 4px 8px !important;
}

.ant-menu-item:hover {
  transform: translateX(8px) !important;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2) !important;
}

.ant-menu-item-selected {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
  border-right: none !important;
  transform: translateX(8px) !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25) !important;
}

.ant-menu-item-selected::after {
  display: none !important;
}

/* 侧边栏收缩动画 */
.ant-layout-sider-collapsed .ant-menu-item {
  justify-content: center !important;
}

.ant-layout-sider-collapsed .ant-menu-item:hover {
  transform: scale(1.1) !important;
}

/* 表格行动画 */
.ant-table-tbody > tr {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ant-table-tbody > tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  background: rgba(102, 126, 234, 0.05) !important;
}

/* 进度条动画 */
.ant-progress-bg {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 标签动画 */
.ant-tag {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}

.ant-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 内容加载动画 */
@keyframes skeletonLoading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: 8px;
}

/* 数据加载状态 */
.loading-state {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-state::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 内容淡入动画 */
.content-fade-in {
  animation: contentFadeIn 0.6s ease-out;
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 列表项逐个显示动画 */
.stagger-animation {
  animation: staggerFadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

@keyframes staggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 为列表项添加延迟 */
.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation:nth-child(8) { animation-delay: 0.8s; }
.stagger-animation:nth-child(9) { animation-delay: 0.9s; }
.stagger-animation:nth-child(10) { animation-delay: 1.0s; }

.ant-layout {
  min-height: 100vh;
  background: transparent !important;
}

.ant-layout-sider {
  box-shadow: 2px 0 20px rgba(0, 21, 41, 0.15);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 0; /* remove rounded corners */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ant-layout-content {
  padding: 24px;
  background: transparent;
  backdrop-filter: blur(5px);
}

.page-header {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 28px;
  margin-bottom: 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.page-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #262626;
}

.page-header p {
  margin: 4px 0 0 0;
  color: #8c8c8c;
  font-size: 14px;
}

.content-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 4px solid #1890ff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.05) 0%, rgba(24, 144, 255, 0.02) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.warning {
  border-left-color: #faad14;
}

.stat-card.warning::before {
  background: linear-gradient(135deg, rgba(250, 173, 20, 0.05) 0%, rgba(250, 173, 20, 0.02) 100%);
}

.stat-card.success {
  border-left-color: #52c41a;
}

.stat-card.success::before {
  background: linear-gradient(135deg, rgba(82, 196, 26, 0.05) 0%, rgba(82, 196, 26, 0.02) 100%);
}

.stat-card.error {
  border-left-color: #ff4d4f;
}

.stat-card.error::before {
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.05) 0%, rgba(255, 77, 79, 0.02) 100%);
}

.stat-card.danger {
  border-left-color: #ff4d4f;
}

.stat-card.success {
  border-left-color: #52c41a;
}

.stat-number {
  font-size: 30px;
  font-weight: 600;
  color: #262626;
  margin-bottom: 8px;
}

.stat-label {
  color: #8c8c8c;
  font-size: 14px;
  margin-bottom: 8px;
}

.stat-trend {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up {
  color: #52c41a;
}

.stat-trend.down {
  color: #ff4d4f;
}

.status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-running {
  background: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.status-warning {
  background: #fffbe6;
  color: #faad14;
  border: 1px solid #ffe58f;
}

.status-error {
  background: #fff2f0;
  color: #ff4d4f;
  border: 1px solid #ffccc7;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #f5f5f5;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-normal {
  background: #52c41a;
}

.progress-warning {
  background: #faad14;
}

.progress-danger {
  background: #ff4d4f;
}

/* SQL 编辑器更强样式覆盖（确保对 AntD Input.TextArea 生效） */
.sql-editor,
.ant-input.sql-editor {
  border: 1px solid #d0d6e0 !important;
  border-radius: 10px !important;
  min-height: 120px;
  font-family: 'Fira Code', 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  padding: 14px 16px !important;
  background-color: #fbfcff !important;
  color: var(--text-color);
  resize: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* 焦点态更明显 */
.sql-editor:focus,
.ant-input.sql-editor:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2) !important;
  outline: none;
  background-color: #ffffff !important;
}

/* 占位符颜色 */
.sql-editor::placeholder {
  color: #bfbfbf !important;
}

/* 兼容深色偏好 */
@media (prefers-color-scheme: dark) {
  .sql-editor,
  .ant-input.sql-editor {
    background-color: #1f1f1f !important;
    border-color: #3a3a3a !important;
  }
  .sql-editor:focus,
  .ant-input.sql-editor:focus {
    background-color: #141414 !important;
  }
}

/* 表格增强：条纹行、紧凑密度、fixed 布局更佳展示宽列 */
.ant-table-striped .table-row-light td {
  background: #ffffff;
}
.ant-table-striped .table-row-dark td {
  background: #fafafa;
}
.ant-table-thead > tr > th {
  background: #f8f9fb !important;
  color: #262626;
  font-weight: 600;
}
.ant-table-cell {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Tabs header 微调，增强可读性 */
.ant-tabs-tab {
  padding: 10px 16px !important;
}
.ant-tabs-ink-bar {
  height: 2px;
}

/* 工具栏按钮组在小屏保持换行与间距 */
@media (max-width: 992px) {
  .toolbar-wrap {
    gap: 8px;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 悬停效果 */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 主题色彩变量 */
:root {
  --primary-color: #1890ff;
  --success-color: #52c41a;
  --warning-color: #faad14;
  --error-color: #ff4d4f;
  --info-color: #13c2c2;
  --text-color: #262626;
  --text-color-secondary: #8c8c8c;
  --background-color: #f0f2f5;
  --card-background: #ffffff;
  --border-color: #f0f0f0;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #ffffff;
    --text-color-secondary: #a6a6a6;
    --background-color: #141414;
    --card-background: #1f1f1f;
    --border-color: #303030;
  }
}

/* 自定义组件样式 */
.custom-card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-light);
  transition: box-shadow 0.3s ease;
}

.custom-card:hover {
  box-shadow: var(--shadow-medium);
}

.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.gradient-bg-success {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.gradient-bg-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.gradient-bg-info {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #262626;
}

.step-content {
  margin-top: 24px;
  padding: 24px;
  background: #fafafa;
  border-radius: 6px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .ant-layout-sider {
    width: 200px !important;
    min-width: 200px !important;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .ant-table-wrapper {
    overflow-x: auto;
  }
  
  .page-header {
    padding: 16px 0;
  }
  
  .page-header h1 {
    font-size: 22px;
  }
}

@media (max-width: 768px) {
  .ant-layout-sider {
    width: 0 !important;
    min-width: 0 !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-card .stat-value {
    font-size: 24px;
  }
  
  .page-header h1 {
    font-size: 20px;
  }
  
  .content-card {
    margin: 0 -12px;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid #f0f0f0;
  }
  
  .ant-layout-content {
    padding: 12px;
  }
  
  .ant-card-body {
    padding: 16px;
  }
  
  .ant-table-wrapper {
    font-size: 12px;
  }
  
  .ant-btn {
    height: 32px;
    padding: 4px 8px;
    font-size: 12px;
  }
}

@media (max-width: 576px) {
  .page-header {
    padding: 12px 0;
  }
  
  .page-header h1 {
    font-size: 18px;
  }
  
  .page-header p {
    font-size: 12px;
  }
  
  .stats-grid {
    gap: 8px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-card .stat-value {
    font-size: 20px;
  }
  
  .stat-card .stat-label {
    font-size: 12px;
  }
  
  .ant-layout-content {
    padding: 8px;
  }
  
  .content-card {
    margin: 0 -8px;
  }
  
  .ant-card-head {
    padding: 0 16px;
    min-height: 48px;
  }
  
  .ant-card-head-title {
    font-size: 14px;
  }
}

/* --- Tree styles for SQLConsole --- */
.modern-tree.db-tree {
  --tree-bg: #ffffff;
  --tree-border: #d9d9d9;
  --tree-text: #262626;
  --tree-muted: #8c8c8c;
  --tree-accent: #1890ff;
  --tree-accent-2: #52c41a;
  --tree-hover: #f0f8ff;
  --tree-selected: #e6f7ff;
  --system-color: #722ed1;
  
  background: var(--tree-bg);
  border: 1px solid var(--tree-border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Reset tree node styling */
.modern-tree.db-tree .ant-tree-treenode {
  position: relative;
  padding: 0;
  margin: 0;
}

/* Tree node content wrapper - main clickable area */
.modern-tree.db-tree .ant-tree-node-content-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
  padding: 4px 12px;
  margin: 2px 4px;
  color: var(--tree-text);
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.modern-tree.db-tree .ant-tree-node-content-wrapper:hover {
  background-color: var(--tree-hover);
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(24, 144, 255, 0.1);
}

.modern-tree.db-tree .ant-tree-node-selected .ant-tree-node-content-wrapper {
  background-color: var(--tree-selected);
  color: var(--tree-accent);
  border: 1px solid rgba(24, 144, 255, 0.3);
  font-weight: 500;
}

/* Switcher (expand/collapse arrow) */
.modern-tree.db-tree .ant-tree-switcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  margin-right: 4px;
  cursor: pointer;
}

/* Custom switcher icon styling */
.switcher-icon {
  color: var(--tree-muted);
  font-size: 12px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.switcher-icon.expanded {
  transform: rotate(90deg);
  color: var(--tree-accent);
}

/* Tree structure lines removed for cleaner appearance */

/* Custom node content styling */
.db-tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

/* Database icons */
.db-tree .db-icon {
  font-size: 18px;
  color: var(--tree-accent);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.db-tree .db-icon.system {
  color: var(--system-color);
}

.modern-tree.db-tree .ant-tree-node-content-wrapper:hover .db-icon {
  transform: scale(1.1);
}

/* Database and table names/* 数据库和表名称：允许完整显示 */
.db-tree .db-name,
.db-tree .table-name {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 14px;
  flex: 1;
  min-width: max-content;
}

.db-tree .db-name.system {
  color: var(--tree-muted);
  font-style: italic;
}

/* System database tag */
.db-tree .db-tag {
  margin-left: auto;
  font-size: 10px;
  color: var(--system-color);
  background: linear-gradient(135deg, rgba(114, 46, 209, 0.1), rgba(114, 46, 209, 0.15));
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(114, 46, 209, 0.3);
  flex-shrink: 0;
  font-weight: 500;
  transition: all 0.2s ease;
}

.db-tree .db-tag:hover {
  background: linear-gradient(135deg, rgba(114, 46, 209, 0.15), rgba(114, 46, 209, 0.2));
  transform: scale(1.05);
}

/* Table node specific styling */
.db-tree .table-name {
  color: var(--tree-text);
}

.modern-tree.db-tree .ant-tree-treenode[data-level="1"] .ant-tree-node-content-wrapper {
  padding-left: 32px;
}

.modern-tree.db-tree .ant-tree-treenode[data-level="2"] .ant-tree-node-content-wrapper {
  padding-left: 56px;
}

/* Table schema link */
.db-tree .table-node .schema-link {
  color: var(--tree-muted);
  font-size: 12px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s;
}

.db-tree .table-node:hover .schema-link {
  opacity: 1;
}

.db-tree .table-node .schema-link:hover {
  color: var(--tree-accent);
}

/* 删除紧凑模式相关样式，统一使用标准高度与缩进 */
/* Compact mode modifications removed for simplification */

/* Virtual scrolling compatibility */
.modern-tree.db-tree .ant-tree-list-holder-inner .ant-tree-treenode {
  height: 36px;
  margin-bottom: 2px;
}

.modern-tree.db-tree .ant-tree-switcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  margin-right: 4px;
  cursor: pointer;
}

/* Custom switcher icon styling */
.switcher-icon {
  color: var(--tree-muted);
  font-size: 12px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.switcher-icon.expanded {
  transform: rotate(90deg);
  color: var(--tree-accent);
}

/* Removed tree guide lines pseudo-element */

/* Removed last-child vertical line override (no longer needed) */

/* Removed horizontal connector line on switcher */

/* Tree indent styling for proper hierarchy display */
.modern-tree.db-tree .ant-tree-treenode {
  padding-left: 0;
}

.modern-tree.db-tree .ant-tree-treenode[data-level="0"] .ant-tree-node-content-wrapper {
  padding-left: 8px;
}

.modern-tree.db-tree .ant-tree-treenode[data-level="1"] .ant-tree-node-content-wrapper {
  padding-left: 32px;
}

.modern-tree.db-tree .ant-tree-treenode[data-level="2"] .ant-tree-node-content-wrapper {
  padding-left: 56px;
}

.modern-tree.db-tree .ant-tree-treenode[data-level="3"] .ant-tree-node-content-wrapper {
  padding-left: 80px;
}

/* Custom node content styling */
.db-tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

/* Database icons */
.db-tree .db-icon {
  font-size: 16px;
  color: var(--tree-accent);
  flex-shrink: 0;
}

.db-tree .db-icon.system {
  color: var(--system-color);
}

/* Database and table names */
/* 数据库和表名称：允许完整显示（去除省略号） */
.db-tree .db-name,
.db-tree .table-name {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 14px;
  flex: 1;
  min-width: max-content;
}

.db-tree .db-name.system {
  color: var(--tree-muted);
  font-style: italic;
}

/* System database tag - removed duplicate definition */

/* Table node specific styling */
.db-tree .table-name {
  color: var(--tree-text);
}

.modern-tree.db-tree .ant-tree-treenode[data-level="1"] .ant-tree-node-content-wrapper {
  padding-left: 32px;
}

.modern-tree.db-tree .ant-tree-treenode[data-level="2"] .ant-tree-node-content-wrapper {
  padding-left: 56px;
}

/* Table schema link */
.db-tree .table-node .schema-link {
  color: var(--tree-muted);
  font-size: 12px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s;
}

.db-tree .table-node:hover .schema-link {
  opacity: 1;
}

.db-tree .table-node .schema-link:hover {
  color: var(--tree-accent);
}

/* 允许横向滚动完整展示树节点文本 */
.db-tree-scroll-inner {
  display: block;
  width: 100%;
  min-width: 0;
  height: 680px; /* 固定高度 */
  overflow-y: auto; /* 内容超出竖向滚动 */
  overflow-x: auto; /* 内容超出横向滚动，滚动条位于底端 */
}

/* 让白色树盒子充满容器高度，保持固定白色区域 */
.modern-tree.db-tree {
  height: 100%;
  overflow-x: auto; /* 允许横向滚动查看完整名称 */
}

/* Tree 内部容器宽度自适应内容，配合横向滚动 */
.modern-tree.db-tree .ant-tree-list-holder-inner {
  width: max-content;
}

/* 展开时不截断名称，交给外层滚动处理（去除省略号，允许完整显示） */
.db-tree .db-name,
.db-tree .table-name {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* 内容包装器允许内容完整展示，宽度随内容自适应 */
.modern-tree.db-tree .ant-tree-node-content-wrapper {
  overflow: visible;
  width: max-content;
}
/* SQL 编辑器根容器覆盖（AntD v5） */
.ant-input-textarea.sql-editor-root {
  border-radius: 12px !important;
}
.ant-input-textarea.sql-editor-root .ant-input {
  background-color: #f4f8ff !important;
  border: 1px solid #91caff !important;
  border-radius: 12px !important;
  padding: 16px !important;
}
.ant-input-textarea.sql-editor-root .ant-input:focus {
  border-color: #1677ff !important;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2) !important;
}